package com.xiangxiao.rpan.file.exception;

import com.xiangxiao.rpan.file.constant.ResponseCode;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2024/1/11 10:46
 */
public class FileException extends RuntimeException {
  /**
   * 错误信息
   */
  private final String msg;

  /**
   * 错误码
   */
  private int errorCode = ResponseCode.FAIL;

  public FileException(String msg) {
    super(msg);
    this.msg = msg;
  }

  public FileException(String msg, int errorCode) {
    super(msg);
    this.msg = msg;
    this.errorCode = errorCode;
  }


  @Override
  public String getMessage() {
    return msg;
  }

  public int getErrorCode() {
    return errorCode;
  }
}
